import request from "@/utils/request";

export async function onLogin(params) {
    return await request.post('mobile/login', params)
}

// 获取事业部
export async function fetchCountryIndex(params) {
    return await request.post('mobile/country', {...params, userGroupId: sessionStorage.getItem('usergroupId')})
}

// 获取业务数据统计---审核
export async function fetchBusinessDataAudit(params) {
    return await request.get('mobile/dataAudit', {params})
}

// 获取业务数据统计---注册
export async function fetchBusinessDataRegister(params) {
    return await request.get('mobile/dataRegister', {params})
}

// 获取业务数据统计---展期
export async function fetchBusinessDataDefer(params) {
    return await request.get('mobile/dataDefer', {params})
}

// 获取业务数据统计---进件
export async function fetchBusinessDataLoan(params) {
    return await request.get('mobile/dataLoan', {params})
}

// 获取业务数据统计---待打款
export async function fetchBusinessDataNotPay(params) {
    return await request.get('mobile/dataNotPay', {params})
}

// 获取业务数据统计---放款
export async function fetchBusinessDataPay(params) {
    return await request.get('mobile/dataPay', {params})
}

// 获取业务数据统计---到期
export async function fetchBusinessDataShould(params) {
    return await request.get('mobile/dataShould', {params})
}

// 获取业务数据统计---提醒催回率
export async function fetchBusinessDataRemind(params) {
    return await request.get('mobile/dataRemind', {params})
}

// 获取业务今日数据
export async function fetchBusinessToday(params) {
    return await request.post('mobile/business_report/today', params)
}

// 获取业务历史数据
export async function fetchBusinessHistory(params) {
    return await request.post('mobile/business_report/history', params)
}

// 获取利润表
export async function fetchFinanceProfit(params) {
    return await request.post('mobile/finance_profit', {...params, usergroupId: sessionStorage.getItem('usergroupId')})
}

// 获取经营分析表
export async function fetchFinanceBusinessAnalysis(params) {
    return await request.post('mobile/finance_business_analysis', {
        ...params,
        usergroupId: sessionStorage.getItem('usergroupId')
    })
}

// 获取损益明细表
export async function fetchFinanceLose(params) {
    return await request.post('mobile/finance_profit_and_loss_details', {
        ...params,
        usergroupId: sessionStorage.getItem('usergroupId')
    })
}

// 获取资产负债
export async function fetchFinanceAssets(params) {
    return await request.post('mobile/finance_assets_liabilities', {
        ...params,
        usergroupId: sessionStorage.getItem('usergroupId')
    })
}

// 获取有财务报表有数据月份
export async function fetchFinanceMonth(params) {
    return await request.post('mobile/getDataNew', {...params, usergroupId: sessionStorage.getItem('usergroupId')})
}

// 获取季度经营预算表
export async function fetchFinanceQuarter(params) {
    return await request.post('mobile/finance_operating_budget', {
        ...params,
        usergroupId: sessionStorage.getItem('usergroupId')
    })
}
